import React, { memo, useState } from 'react'
import { getImageUrl } from './util/getImageUrl'
import { Select } from 'antd'

const App = memo(() => {
  const [pictureSrc, setpictureSrc] = useState("alarm");
  // const { Option } = Select;
  // let items = ['图1', '图2']
  // let SelectItems = [];
  // for (let i of items) {
  //   SelectItems.push(<Option key={i} value={i}>{i}</Option>)
  // }
  return (
    <div style={{ width: '200px', height: '200px' }}>
      <Select
        defaultValue="图1"
        style={{ width: 120 }}
        // onChange={handleChange}
        options={[
          { value: '图1', label: '图1' },
          { value: '图2', label: '图2' },
        ]}
      />
      <img src={getImageUrl(pictureSrc)} alt="" />
    </div>
  )
})

export default App